<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <script src="../封装函数.js"></script> -->
    <link rel="stylesheet" href="./css/商品列表跳转1.css">
  
    <style>
        
       
    </style>
  
</head>
<body>
    
   
    <ul class="box">
        <!-- <li>
            <span>三星平板电视</span>
            <span>30天全网销售： 242408</span>
        </li>
        <li>
            <span>三星平板电视</span>
            <span>30天全网销售： 242408</span>
        </li> <li>
            <span>三星平板电视</span>
            <span>30天全网销售： 242408</span>
        </li> -->
    </ul>
<script src="./js/jquery.min.js"></script>
    <script>

        var brandtitleid=localStorage.getItem('brandtitleId')
        console.log(brandtitleid)

        var categoryid=localStorage.getItem('categoryid')
        console.log(brandtitleid)
       var box=document.querySelector('.box')
       
        let xhr2=new XMLHttpRequest()
        xhr2.open('get',`http://chst.vip:1234/api/getbrand?brandtitleid=${brandtitleid}&categoryid=${categoryid}`,true,)
        xhr2.onload=function(){

            if(xhr2.status===200){
                var res2=JSON.parse(xhr2.responseText)
                 console.log(res2.result)
            var lis2=''
            var n=1

            res2.result.forEach(function(so,ind){
                lis2+=`
                <li brandtitleid='${so.brandTitleId}' pagesize='4'>
                    <span>${so.brandName}</span>
                    <span>${so.brandInfo}</span>
                    <span>${n++}</span>
                    <span class='sp'> > </span>
                </li>`
            })
            }
            box.innerHTML=lis2
        }
   
        xhr2.send()


        box.onclick=function(ev){

            let e=ev||window.event

            let target=e.target||e.srcElement
            console.log(target.nodeName);

            if(target.nodeName==='LI'){
                var pagesize=target.getAttribute('pagesize')
               
            }
            // location.href=`./商品跳转详情页.html?pagesize=4`
            location.href=`./商品跳转2.html?pagesize=4`
        }
      

    </script>
</body>
</html>